#include <stdio.h>
#include <stdint.h>
#include <audio_agc.h>

int Agc_Process(void *agcInst, const int16_t *in_near, int16_t samples,
				int16_t *out, int32_t inMicLevel,
				int32_t *outMicLevel, int16_t echo,
				uint8_t *saturationWarning, int size)
{
	int ret = -1;
	int k, i = size /(samples*2);
	const int16_t *p = in_near;
	int16_t *q = out;

	for (k = 0;k < i; k++){
		const int16_t *ptmp = p+samples*k;
		int16_t *qtmp = q + samples*k;
		const int16_t *const *pp = &ptmp;
		int16_t *const *qq = &qtmp;
		ret = audio_process_agc_process(agcInst,pp,1,samples,qq,inMicLevel,outMicLevel,echo,saturationWarning);

		if(ret != 0){
			printf("audio_agc_process error\n");
			return-1;
		}
	}
	return 0;
}
